package cn.jdx.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/*
【测试】:获取json数据
 */
@RestController
public class GetJsonStringController {
    @RequestMapping("/json")
    public Object getJsonString(){
        System.out.println("[控制器]:获得json数据");
        return new People("张三","男");
    }
}

class People{
    private String name;
    private String sex;

    public People(String name, String sex) {
        this.name = name;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
